package com.linyf.design.chain;

import com.linyf.design.chain.dto.Request;
import com.linyf.design.chain.dto.Response;

/**
 * @Author: linyf
 * @DateTime: 2023/4/26 10:00
 **/
public class Main {

    public static void main(String[] args) {

        Handler handlerOne = new RequestOneHandler();
        Handler handlerTwo = new RequestTwoHandler();
        Handler handlerThree = new RequestThreeHandler();


        handlerOne.setNextHandler(handlerTwo);
        handlerTwo.setNextHandler(handlerThree);


        final Request request = new Request();
        request.setRequest("three");

        final Response response = handlerOne.handlerMessage(request);
        System.err.println(response.getResult());

    }
}
